344-reverse-string.py
problem: ---
problem:

Write a function that reverses a string. The input string is given as an array of characters char[].
Do not allocate extra space for another array, you must do this by modifying the input array 
in-place with O(1) extra memory.
You may assume all the characters consist of printable ascii characters.

Example 1:
Input: ["h","e","l","l","o"]
Output: ["o","l","l","e","h"]

Example 2:
Input: ["H","a","n","n","a","h"]
Output: ["h","a","n","n","a","H"]
---

-----------------------------------------------------------------------
bug_fixes: ---
bug_fixes:
Replace `len(s)` with `len(s) - 1` on line 3.
Replace `+` with `-` on line 7.
---

-----------------------------------------------------------------------
bug_desc: ---
bug_desc:
On line 3, end is set to len(s) which could result in an IndexError because it is out of bounds. To fix this, set end to len(s)-1.
On line 7, end is incremented by 1. This causes an infinite loop since start and end are both incremented. To fix this, decrement end by 1.
---

-----------------------------------------------------------------------
line_no: ---
line_no:
3
---

-----------------------------------------------------------------------
buggy_code: ---
buggy_code:
1. class Solution:
2.     def reverseString(self, s: List[str]) -> None:
3.         start, end = 0, len(s)
4.         while start < end:
5.           s[start], s[end] = s[end], s[start]
6.           start += 1
7.           end += 1
8. 
---

-----------------------------------------------------------------------
correct_code: ---
correct_code:
1. class Solution:
2.     def reverseString(self, s: List[str]) -> None:
3.         start, end = 0, len(s) - 1
4.         while start < end:
5.           s[start], s[end] = s[end], s[start]
6.           start += 1
7.           end -= 1
8. 
---

-----------------------------------------------------------------------
